<?php

/**
 * FactureFournesseurAvoirFournesseur form base class.
 *
 * @method FactureFournesseurAvoirFournesseur getObject() Returns the current form's model object
 *
 * @package    SdCommerce
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseFactureFournesseurAvoirFournesseurForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                        => new sfWidgetFormInputHidden(),
      'facture_frournesseur_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureFournisseur'), 'add_empty' => true)),
      'facture_avoir_fournesseur' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureAvoirFournesseur'), 'add_empty' => true)),
      'created_at'                => new sfWidgetFormDateTime(),
      'updated_at'                => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                        => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'facture_frournesseur_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FactureFournisseur'), 'required' => false)),
      'facture_avoir_fournesseur' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FactureAvoirFournesseur'), 'required' => false)),
      'created_at'                => new sfValidatorDateTime(),
      'updated_at'                => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('facture_fournesseur_avoir_fournesseur[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'FactureFournesseurAvoirFournesseur';
  }

}
